/** 
 * 
	工单管理接口
*/

import {http} from '@/utils/http';


/* 获得生产任务分页 */
export const getByworkId = (params: any) => http({
	url: '/mes/pro-task/getByworkId',
	params,
});

export const getProcessList = () => http({
	url: '/mes/process/simple-list'
});

/* 获得生产任务分页 */
export const proTask = (params: any) => http({
	url: '/mes/pro-task/page',
	params,
});

export const getDefectRecordList = (params: any) => http({
	url: '/mes/defect-record/list',
	params,
});

export const getQcLineRecord = (params: any) => http({
	url: '/mes/qc-line-record/page',
	params,
});

/* 获取生产任务信息 */
export const getTaskInfo = (params: any) => http({
	url: '/mes/pro-task/get',
	params,
})

export const updateTask = (data) => http({
	url: '/mes/pro-task/update',
	method: 'PUT',
	data
}) 

/* 获取生产工单 BOM 组成列表 */
export const getListByWorkOrderId =  (params: any) => http({
	url: '/mes/workorder/workorder-bom/list-by-workorder-id',
	params,
})

export const getFeedbackInfo = (params) => http({
	url: '/mes/pro-feedback/get',
	params,
}) 

export const createIpqc = (data) => http({
	url: '/mes/ipqc/create',
	method: 'POST',
	data
}) 

export const updateIpqc = (data) => http({
	url: '/mes/ipqc/update',
	method: 'PUT',
	data
}) 

export const getPendingInfo = (params) => http({
	url: '/mes/qc/pending/get',
	params,
}) 

export const getFeedback = (params) => http({
	url: '/mes/pro-feedback/page',
	params,
}) 



export const getUsers = (params) => http({
	url: '/system/user/page',
	params,
})

export const createAppMore = (data) => http({
	url: '/mes/pro-feedback/createAppMore',
	method: 'POST',
	data,
})

export const getProduct = (params) => http({
	url: '/erp/product/page',
	params,
})

export const getSimpleList = () => http({
	url: '/erp/warehouse/simple-list',
})



export const stockIssue = (params) => http({
	url: '/erp/stock-issue/page',
	params,
})

export const createStockIssue2 = (data) => http({
	url: '/erp/stock-issue/scnCreate',
	method: 'POST',
	data
});

export const createStockIssue = (data) => http({
	url: '/erp/stock-issue/create',
	method: 'POST',
	data
});

export const updateStockIssue = (data) => http({
	url: '/erp/stock-issue/update',
	method: 'PUT',
	data
});

export const getStockIssueInfo = (params) => http({
	url: '/erp/stock-issue/get',
	params,
}) 

  export const updateStockIssueStatus = (params : any) => http({
    url: '/erp/stock-issue/update-status',
    params,
	method: 'PUT',
  });